home *** CD-ROM | disk | FTP | other *** search
/ Windows News 1997 February / Windows News CD #1 - Fev 97.iso / drivers / wntp345 / oemsetup.inf < prev    next >
Encoding:
INI File  |  1997-01-22  |  18.3 KB  |  572 lines

  1. ;-----------------------------------------------------------------------
  2. ; OPTION TYPE
  3. ; -----------
  4. ; This identifies the Option type we are dealing with.  The different
  5. ; possible types are:
  6. ;
  7. ; COMPUTER, VIDEO, POINTER, KEYBOARD, LAYOUT, SCSI, TAPE, PRINTER, ...
  8. ;-----------------------------------------------------------------------
  9.  
  10. [Identification]
  11.     OptionType = SCSI
  12.  
  13. ;-----------------------------------------------------------------------
  14. ; LANGUAGES SUPPORTED
  15. ; -------------------
  16. ;
  17. ; The languages supported by the INF, For every language supported
  18. ; we need to have a separate text section for every displayable text
  19. ; section.
  20. ;
  21. ;-----------------------------------------------------------------------
  22.  
  23. [LanguagesSupported]
  24.     ENG
  25.  
  26.  
  27. ;-----------------------------------------------------------------------
  28. ; OPTION LIST
  29. ; -----------
  30. ; This section lists the Option key names.  These keys are locale
  31. ; independent and used to represent the option in a locale independent
  32. ; manner.
  33. ;
  34. ;-----------------------------------------------------------------------
  35.  
  36. [Options]
  37.     "EPATHD"    = epathdx
  38.  
  39. ;-----------------------------------------------------------------------
  40. ; OPTION TEXT SECTION
  41. ; -------------------
  42. ; These are text strings used to identify the option to the user.  There
  43. ; are separate sections for each language supported.  The format of the
  44. ; section name is "OptionsText" concatenated with the Language represented
  45. ; by the section.
  46. ;
  47. ;-----------------------------------------------------------------------
  48.  
  49. [OptionsTextENG]
  50.     "EPATHD"    = "SyQuest EPATHD Parallel to ATA adapter"
  51.  
  52.  
  53. ;-----------------------------------------------------------------------------------------
  54. ; SCSI MINIPORT DRIVERS:
  55. ;
  56. ; Order of the information:
  57. ;
  58. ; Class driver = Type, Group, ErrorControl, Tag, EventMessageFile, TypesSupported
  59. ;
  60. ;-----------------------------------------------------------------------------------------
  61.  
  62. [MiniportDrivers]
  63.     epathdx  = !SERVICE_KERNEL_DRIVER, "SCSI Miniport", !SERVICE_ERROR_NORMAL,  17, %SystemRoot%\System32\IoLogMsg.dll , 7, "v1.0▀ release for Windows NT v3.1"
  64.  
  65. ;---------------------------------------------------------------------------
  66. ; 1. Identify
  67. ;
  68. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  69. ;                as we are choosing currently.
  70. ;
  71. ; INPUT:         None
  72. ;
  73. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  74. ;                $($R1): Option Type (COMPUTER ...)
  75. ;                $($R2): Diskette description
  76. ;---------------------------------------------------------------------------
  77.  
  78. [Identify]
  79.     ;
  80.     ;
  81.     read-syms Identification
  82.  
  83.     set Status     = STATUS_SUCCESSFUL
  84.     set Identifier = $(OptionType)
  85.     set Media      = #("Source Media Descriptions", 1, 1)
  86.  
  87.     Return $(Status) $(Identifier) $(Media)
  88.  
  89.  
  90.  
  91. ;------------------------------------------------------------------------
  92. ; 2. ReturnOptions:
  93. ;
  94. ; DESCRIPTION:   To return the option list supported by this INF and the
  95. ;                localised text list representing the options.
  96. ;
  97. ;
  98. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  99. ;
  100. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  101. ;                                STATUS_NOLANGUAGE
  102. ;                                STATUS_FAILED
  103. ;
  104. ;                $($R1): Option List
  105. ;                $($R2): Option Text List
  106. ;------------------------------------------------------------------------
  107.  
  108. [ReturnOptions]
  109.     ;
  110.     ;
  111.     set Status        = STATUS_FAILED
  112.     set OptionList     = {}
  113.     set OptionTextList = {}
  114.  
  115.     ;
  116.     ; Check if the language requested is supported
  117.     ;
  118.     set LanguageList = ^(LanguagesSupported, 1)
  119.     Ifcontains(i) $($0) in $(LanguageList)
  120.         goto returnoptions
  121.     else
  122.         set Status = STATUS_NOLANGUAGE
  123.         goto finish_ReturnOptions
  124.     endif
  125.  
  126.     ;
  127.     ; form a list of all the options and another of the text representing
  128.     ;
  129.  
  130. returnoptions = +
  131.     set OptionList     = ^(Options, 0)
  132.     set OptionTextList = ^(OptionsText$($0), 1)
  133.     set Status         = STATUS_SUCCESSFUL
  134.  
  135. finish_ReturnOptions = +
  136.     Return $(Status) $(OptionList) $(OptionTextList)
  137.  
  138.  
  139. ;
  140. ; 3. InstallOption:
  141. ;
  142. ; FUNCTION:  To copy files representing Options
  143. ;            To configure the installed option
  144. ;            To update the registry for the installed option
  145. ;
  146. ; INPUT:     $($0):  Language to use
  147. ;            $($1):  OptionID to install
  148. ;            $($2):  SourceDirectory
  149. ;            $($3):  AddCopy  (YES | NO)
  150. ;            $($4):  DoCopy   (YES | NO)
  151. ;            $($5):  DoConfig (YES | NO)
  152. ;
  153. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  154. ;                            STATUS_NOLANGUAGE |
  155. ;                            STATUS_USERCANCEL |
  156. ;                            STATUS_FAILED
  157. ;
  158.  
  159. [InstallOption]
  160.  
  161.     ;
  162.     ; Set default values for
  163.     ;
  164.     set Status = STATUS_FAILED
  165.     set DrivesToFree = {}
  166.  
  167.     ;
  168.     ; extract parameters
  169.     ;
  170.     set Option   = $($1)
  171.     set SrcDir   = $($2)
  172.     set AddCopy  = $($3)
  173.     set DoCopy   = $($4)
  174.     set DoConfig = $($5)
  175.  
  176.     ;
  177.     ; Check if the language requested is supported
  178.     ;
  179.     set LanguageList = ^(LanguagesSupported, 1)
  180.     Ifcontains(i) $($0) in $(LanguageList)
  181.     else
  182.         set Status = STATUS_NOLANGUAGE
  183.         goto finish_InstallOption
  184.     endif
  185.     read-syms Strings$($0)
  186.  
  187.     ;
  188.     ; check to see if Option is supported.
  189.     ;
  190.  
  191.     set OptionList = ^(Options, 0)
  192.     ifcontains $(Option) in $(OptionList)
  193.     else
  194.         Debug-Output "SCSI.INF: SCSI option is not supported."
  195.         goto finish_InstallOption
  196.     endif
  197.     set OptionList = ""
  198.  
  199.     ;
  200.     ; Option has been defined already
  201.     ;
  202.  
  203.     set MiniportDriver   =   #(Options,         $(Option),         1)
  204.     set Type             = $(#(MiniportDrivers, $(MiniportDriver), 1))
  205.     set Group            =   #(MiniportDrivers, $(MiniportDriver), 2)
  206.     set ErrorControl     = $(#(MiniportDrivers, $(MiniportDriver), 3))
  207.     set Tag              =   #(MiniportDrivers, $(MiniportDriver), 4)
  208.     set EventMessageFile =   #(MiniportDrivers, $(MiniportDriver), 5)
  209.     set TypesSupported   =   #(MiniportDrivers, $(MiniportDriver), 6)
  210.     set DriverVersion    =   #(MiniportDrivers, $(MiniportDriver), 7)
  211.  
  212.     set Start            =   $(!SERVICE_BOOT_START)
  213.  
  214. installtheoption = +
  215.  
  216.     ;
  217.     ; Code to add files to copy list
  218.     ;
  219.  
  220.     ifstr(i) $(AddCopy) == "YES"
  221.         set DoActualCopy = NO
  222.         set FileToCheck = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  223.         LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(!STF_WINDOWSSYSPATH)"\drivers\"$(FileToCheck)
  224.         ifstr(i) $(STATUS) == NO
  225.             set DoActualCopy = YES
  226.         endif
  227.  
  228.         ifstr(i) $(DoActualCopy) == NO
  229.             shell "subroutn.inf" DriversExist $($0) $(String1)
  230.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  231.                 Debug-Output "SCSI.INF: shelling DriversExist failed"
  232.                 goto finish_InstallOption
  233.             endif
  234.  
  235.             ifstr(i) $($R0) == STATUS_CURRENT
  236.             else-ifstr(i) $($R0) == STATUS_NEW
  237.                 set DoActualCopy = YES
  238.             else-ifstr(i) $($R0) == STATUS_USERCANCEL
  239.                 Debug-Output "SCSI.INF: User cancelled SCSI installation"
  240.                 goto finish_InstallOption
  241.             else
  242.                 Debug-Output "SCSI.INF: Error reported in DriversExist routine in SUBROUTN.INF"
  243.                 goto finish_InstallOption
  244.             endif
  245.         endif
  246.  
  247.         ifstr(i) $(DoActualCopy) == YES
  248.  
  249.             shell "subroutn.inf" DoAskSourceEx $(SrcDir) $(String2)
  250.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  251.                 Debug-Output "SCSI.INF: shelling DoAskSourceEx failed"
  252.                 goto finish_InstallOption
  253.             endif
  254.  
  255.             ifstr(i) $($R0) == STATUS_SUCCESSFUL
  256.                 set SrcDir = $($R1)
  257.                 ifstr(i) $($R2) != ""
  258.                     set DrivesToFree = >($(DrivesToFree), $($R2))
  259.                 endif
  260.             else
  261.                 Debug-Output "SCSI.INF: User cancelled asking source."
  262.                 goto finish_InstallOption
  263.             endif
  264.  
  265.             install Install-AddCopyOption
  266.             ifstr(i) $(STF_INSTALL_OUTCOME) != "STF_SUCCESS"
  267.                 Debug-Output "Adding SCSI files to copy list failed"
  268.                 goto finish_InstallOption
  269.             endif
  270.         else
  271.             set DoCopy = NO
  272.         endif
  273.  
  274.     endif
  275.  
  276.     ifstr(i) $(DoCopy) == "YES"
  277.         read-syms ProgressCopy$($0)
  278.         install Install-DoCopyOption
  279.         ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  280.             Debug-Output "Copying files failed"
  281.             goto finish_InstallOption
  282.         else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  283.             set Status = STATUS_USERCANCEL
  284.             goto finish_InstallOption
  285.         endif
  286.     endif
  287.  
  288.     ifstr(i) $(DoConfig) == "YES"
  289.         ;
  290.         ; first run a privilege check on modifying the setup node
  291.         ;
  292.  
  293.         shell "registry.inf" CheckSetupModify
  294.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  295.             goto finish_InstallOption
  296.         endif
  297.  
  298.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  299.             goto finish_InstallOption
  300.         endif
  301.  
  302.         ;
  303.         ; then make a new SCSI entry, the entry is created automatically
  304.         ; enabled
  305.         ;
  306.  
  307.         set ServiceNode   = $(MiniportDriver)
  308.         set ServiceBinary = System32\drivers\#(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  309.  
  310.         set ServicesValues   = { +
  311.                 {Type,           0, $(!REG_VT_DWORD),     $(Type)                  }, +
  312.                 {Start,          0, $(!REG_VT_DWORD),     $(Start)                 }, +
  313.                 {Group,          0, $(!REG_VT_SZ),        $(Group)                 }, +
  314.                 {ErrorControl,   0, $(!REG_VT_DWORD),     $(ErrorControl)          }, +
  315.                 {Tag,            0, $(!REG_VT_DWORD),     $(Tag)                   }, +
  316.                 {BinaryPathName, 0, $(!REG_VT_EXPAND_SZ), $(ServiceBinary)         }  +
  317.                 {DriverVersion,  0, $(!REG_VT_SZ),        $(DriverVersion)         }, +
  318.                 {DriverParameter,  0, $(!REG_VT_SZ),      $(DriverParameter)        }, +
  319.                 }
  320.         set ParametersValues = ""
  321.         set DeviceValues     = {}
  322.         set EventLogValues   = { +
  323.                 {EventMessageFile, 0, $(!REG_VT_EXPAND_SZ), $(EventMessageFile) }, +
  324.                 {TypesSupported,   0, $(!REG_VT_DWORD),     $(TypesSupported)   }  +
  325.                 }
  326.  
  327.         shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  328.                                                 $(ServicesValues)   +
  329.                                                 $(ParametersValues) +
  330.                                                 $(DeviceValues)     +
  331.                                                 $(EventLogValues)   +
  332.                                                 Parameters
  333.  
  334.  
  335.  
  336.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  337.             Debug-Output "Couldn't execute MakeServicesEntry in registry.inf"
  338.             goto finish_InstallOption
  339.         endif
  340.  
  341.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  342.             Debug-Output "MakeServicesEntry failed for SCSI"
  343.             goto finish_InstallOption
  344.         endif
  345.  
  346.     endif
  347.  
  348.     set Status = STATUS_SUCCESSFUL
  349. finish_InstallOption = +
  350.     ForListDo $(DrivesToFree)
  351.         LibraryProcedure STATUS,$(!LIBHANDLE), DeleteNetConnection $($) "TRUE"
  352.     EndForListDo
  353.  
  354.     Return $(Status)
  355.  
  356.  
  357. [Install-AddCopyOption]
  358.  
  359.     ;
  360.     ; Add the files to the copy list
  361.     ;
  362.     AddSectionKeyFileToCopyList   Files-ScsiMiniportDrivers         +
  363.                                   $(MiniportDriver)                 +
  364.                                   $(SrcDir)                      +
  365.                                   $(!STF_WINDOWSSYSPATH)\drivers
  366.  
  367.     exit
  368.  
  369.  
  370. [Install-DoCopyOption]
  371.  
  372.     ;
  373.     ; Copy files in the copy list
  374.     ;
  375.     CopyFilesInCopyList
  376.     exit
  377.  
  378. ;-------------------------------------------------------------------------
  379. ; 4. DeInstallOption:
  380. ;
  381. ; FUNCTION:  To remove files representing Option
  382. ;            To remove the registry entry corresponding to the Option
  383. ;
  384. ; INPUT:     $($0):  Language to use
  385. ;            $($1):  OptionID to install
  386. ;
  387. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  388. ;                            STATUS_NOLANGUAGE |
  389. ;                            STATUS_USERCANCEL |
  390. ;                            STATUS_FAILED
  391. ;-------------------------------------------------------------------------
  392. [DeInstallOption]
  393.     ;
  394.     ; Set default values for
  395.     ;
  396.     set Status   = STATUS_FAILED
  397.     ;
  398.     ; extract parameters
  399.     ;
  400.     set Option   = $($1)
  401.  
  402.     ;
  403.     ; Check if the language requested is supported
  404.     ;
  405.     set LanguageList = ^(LanguagesSupported, 1)
  406.     Ifcontains(i) $($0) in $(LanguageList)
  407.     else
  408.         set Status = STATUS_NOLANGUAGE
  409.         goto finish_DeInstallOption
  410.     endif
  411.     read-syms Strings$($0)
  412.  
  413.     ;
  414.     ; check to see if Option is supported.
  415.     ;
  416.  
  417.     set OptionList = ^(Options, 0)
  418.     ifcontains $(Option) in $(OptionList)
  419.     else
  420.         goto finish_DeInstallOption
  421.     endif
  422.     set OptionList = ""
  423.  
  424.     ;
  425.     ; fetch details about option
  426.     ;
  427.  
  428.     set MiniportDriver = #(Options, $(Option), 1)
  429.     set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  430.     set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  431.  
  432.     ;
  433.     ; check to see if file is installed
  434.     ; if not give success
  435.     ;
  436.  
  437.     LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  438.     ifstr(i) $(STATUS) == "NO"
  439.         set Status = STATUS_SUCCESSFUL
  440.         goto finish_DeInstallOption
  441.     endif
  442.  
  443.     shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
  444.     ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
  445.         ; this could happen if there is no start value or there is no
  446.         ; key, in which case the option is not installed
  447.         set Status = STATUS_SUCCESSFUL
  448.         goto finish_DeInstallOption
  449.     endif
  450.  
  451.     ifstr(i) $($R1) == $(!SERVICE_BOOT_START)
  452.         shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "WARNING" $(String3)
  453.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  454.             goto do_removal
  455.         endif
  456.         ifstr(i) $($R1) == "CANCEL"
  457.             goto finish_DeInstallOption
  458.         endif
  459.     endif
  460.  
  461. do_removal =+
  462.     ;
  463.     ; disable the registry entry
  464.     ;
  465.  
  466.     shell "registry.inf" RemoveServicesEntry $(MiniportDriver)
  467.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  468.         Debug-Output "SCSI.INF: Failed to shell RemoveServicesEntry"
  469.         goto finish_DeInstallOption
  470.     endif
  471.  
  472.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  473.         Debug-Output "SCSI.INF: Failed to disable services entry"
  474.         goto finish_DeInstallOption
  475.     endif
  476.  
  477.     ;
  478.     ; we won't remove the file because we can only do so during the next boot.
  479.     ; if the user chooses to reinstall the same driver during this boot
  480.     ; he will still end up deleting the driver on next boot. if the file
  481.     ; should be deleted a warning should be put up saying that the user should
  482.     ; not try to reinstall the driver during this boot
  483.     ;
  484.     ;    AddFileToDeleteList $(FilePath)
  485.  
  486.     set Status = STATUS_SUCCESSFUL
  487.  
  488. finish_DeInstallOption =+
  489.     return $(Status)
  490.  
  491.  
  492. ;-------------------------------------------------------------------------
  493. ; 5. GetInstalledOptions:
  494. ;
  495. ; FUNCTION:  To find out the list of options which are installed
  496. ;
  497. ; INPUT:     $($0): Language to Use
  498. ;
  499. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  500. ;                            STATUS_FAILED
  501. ;
  502. ;            $($R1): List of options installed
  503. ;            $($R2): Option installed Text List
  504. ;-------------------------------------------------------------------------
  505. [GetInstalledOptions]
  506.     set Status = STATUS_FAILED
  507.     set InstalledOptions = {}
  508.     set InstalledOptionsText = {}
  509.  
  510.     ;
  511.     ; Check if the language requested is supported
  512.     ;
  513.     set LanguageList = ^(LanguagesSupported, 1)
  514.     Ifcontains(i) $($0) in $(LanguageList)
  515.     else
  516.         set Status = STATUS_NOLANGUAGE
  517.         goto finish_GetInstalledOptions
  518.     endif
  519.  
  520.     set OptionList = ^(Options, 0)
  521.     ForListDo $(OptionList)
  522.         set MiniportDriver = #(Options, $($), 1)
  523.         set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  524.         set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  525.         LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  526.         ifstr(i) $(STATUS) == "YES"
  527.             shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
  528.             ifint $($ShellCode) == $(!SHELL_CODE_OK)
  529.                 ifstr(i) $($R0) == STATUS_SUCCESSFUL
  530.                     ifstr(i) $($R1) != $(!SERVICE_DISABLED)
  531.  
  532.                         set OptionText = #(OptionsText$($0), $($), 1)
  533.                         set InstalledOptions     = >($(InstalledOptions), $($))
  534.                         set InstalledOptionsText = >($(InstalledOptionsText), $(OptionText))
  535.  
  536.                     endif
  537.                 endif
  538.             endif
  539.         endif
  540.     EndForListDo
  541.     set Status = STATUS_SUCCESSFUL
  542. finish_GetInstalledOptions =+
  543.     Return $(Status) $(InstalledOptions) $(InstalledOptionsText)
  544.  
  545.  
  546. ;**************************************************************************
  547. ; PROGRESS GUAGE VARIABLES
  548. ;**************************************************************************
  549.  
  550. [ProgressCopyENG]
  551.     ProCaption   = "Windows NT Setup"
  552.     ProCancel    = "Cancel"
  553.     ProCancelMsg = "Windows NT is not correcly installed.  Are you sure you want "+
  554.                    "to cancel copying files?"
  555.     ProCancelCap = "Setup Message"
  556.     ProText1     = "Copying:"
  557.     ProText2     = "To:"
  558.  
  559. [StringsENG]
  560.     String1 = "SCSI Adapter"
  561.     String2 = "Please enter the full path to the OEM SCSI "+
  562.               "Adapter files.  Then choose Continue."
  563.     String3 = "The SCSI Adapter has been marked as a boot device.  Removing "+
  564.               "it may cause the system not to boot."$(!LF)$(!LF)"Are you sure "+
  565.               "you want to remove the Adapter."
  566.  
  567. [Source Media Descriptions]
  568.     1  = "SyQuest EPATHD Parallel to ATA adapter Drivers Disk 1 of 1"  , TAGFILE = disk1
  569.  
  570. [Files-ScsiMiniportDrivers]
  571. epathdx = 1,epathd.drv , SIZE=52736
  572.